.message-box {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 500; /* 降低层级，避免遮挡header时间区域 */
  max-width: 320px;
}

/* 收起心情墙，仅保留按钮与弹窗能力 */
.messages-display {
  display: none;
}

/* 留言按钮 - 可爱毛玻璃风格 */
.message-toggle-btn {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #4a5568;
  border: 2px solid rgba(255, 255, 255, 0.3);
  padding: 14px 22px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.message-toggle-btn:hover {
  transform: translateY(-3px) scale(1.05);
  background: rgba(255, 255, 255, 0.35);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 12px 40px rgba(31, 38, 135, 0.25);
}

/* 留言表单遮罩 */
.message-form-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
}

/* 留言表单 - 毛玻璃可爱风格 */
.message-form {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-radius: 24px;
  padding: 28px;
  width: 90%;
  max-width: 420px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.4);
  animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.message-form h3 {
  margin: 0 0 24px 0;
  color: #2d3748;
  font-size: 20px;
  text-align: center;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.message-form textarea {
  width: 100%;
  border: 2px solid rgba(226, 232, 240, 0.8);
  border-radius: 16px;
  padding: 18px;
  font-size: 15px;
  resize: vertical;
  font-family: inherit;
  transition: all 0.3s ease;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.message-form textarea:focus {
  outline: none;
  border-color: #667eea;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
}

.char-count {
  font-size: 13px;
  color: #718096;
  font-weight: 500;
}

.buttons {
  display: flex;
  gap: 14px;
}

.cancel-btn,
.submit-btn {
  padding: 10px 18px;
  border-radius: 12px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  font-family: inherit;
}

.cancel-btn {
  background: rgba(226, 232, 240, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #4a5568;
  border: 1px solid rgba(226, 232, 240, 0.6);
}

.cancel-btn:hover {
  background: rgba(226, 232, 240, 0.9);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.submit-btn {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* 留言展示区域 - 毛玻璃可爱风格 */
.messages-display {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 24px;
  margin-top: 18px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.messages-display h4 {
  margin: 0 0 18px 0;
  color: #2d3748;
  font-size: 17px;
  text-align: center;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.messages-list {
  max-height: 320px;
  overflow-y: auto;
}

.messages-list::-webkit-scrollbar {
  width: 6px;
}

.messages-list::-webkit-scrollbar-track {
  background: rgba(226, 232, 240, 0.3);
  border-radius: 3px;
}

.messages-list::-webkit-scrollbar-thumb {
  background: rgba(102, 126, 234, 0.4);
  border-radius: 3px;
}

.message-item {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 14px;
  border-left: 4px solid #667eea;
  border: 1px solid rgba(255, 255, 255, 0.4);
  transition: all 0.3s ease;
}

.message-item:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: translateX(4px);
}

.message-text {
  color: #2d3748;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 10px;
  font-weight: 500;
}

.message-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #718096;
}

.message-author {
  font-weight: 600;
  color: #667eea;
}

.more-messages {
  text-align: center;
  color: #667eea;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 10px;
  border-radius: 12px;
  transition: all 0.3s ease;
  background: rgba(102, 126, 234, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.more-messages:hover {
  background: rgba(102, 126, 234, 0.2);
  transform: translateY(-1px);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .message-box {
    bottom: 16px;
    right: 16px;
    max-width: 280px;
  }

  .message-form {
    width: 95%;
    padding: 24px;
  }

  .message-toggle-btn {
    padding: 12px 18px;
    font-size: 13px;
  }
}
